package org.csu.mall.common;


import com.google.common.collect.Sets;

import java.math.BigDecimal;
import java.util.Set;

//常量类
public class CONSTANT {
    public static final String LIMIT_NUM_SUCCESS = "LIMIT_NUM_SUCCESS";
    public static final String LIMIT_NUM_FAILURE = "LIMIT_NUM_FAILURE";
    public static final String LOGIN_USER = "loginUser";//登录用户
    public static final String USERINFO="userinfo";//用户信息
    public static final String USERQUESTION="userquestion";//密保问题
    public static final String CHECKANSWERTOKEN="checkanswertoken";//核对密保后给的token
    public static final String UPDATEUSER="updateuser";//更新用户信息
    public static final String ADDBALANCE="addbalance";
    public static final String USERNAME = "username";
    public static final String EMAIL = "email";
    public static final String BANK="bank";
    public static  final String UPDATEBANK="updatebank";
    public static final String BANKLIST="banklist";
    public static final String SHIPPING="shipping";
    public static final String SHIPPINGList="shippinglist";
    public static final BigDecimal BALANCE= BigDecimal.valueOf(0);
    public static final String SHOP="shop";
//    public
    public static final String ADDPRODUCT="addproduct";//添加的商品
    public static final String UPDATEPRODUCT="updateproduct";
    public static final String PRODUCTINFO="productinfo";//获取商品信息
    public static final String PRODUCTLIST="productlist";//获取商品列表
    public static final String PRODUCTS="products";
    public static final String RECOMMENDPRODUCTS="recommendproducts";
    public static final String CATEGORYLIST="categorylist";//获取品类列表
    public static final String CATEGORYINDEXLIST="categoryindexlist";//品类id的列表
    public static final String ALLCATEGORY="allcategory";//所有类别
    public static final String PARENTNAMES="parentnames";
    public static final String CARTITEMLIST="cartitemlist";//购物车列表
    public static final String ADDCART="addcart";
    public static final String UPDATECART="updatecart";
    public static final String DELETECART="deletecart";
    public static final String DELETEMANYCART="deletemanycart";
    public static final String ADDCATEGORY="addcategory";
    public static final String SETCATEGORYNAME="setcategoryname";
    public static final String ORDERDETAIL="orderdetail";
    public static final String COMMITORDER="commitorder";
    public static final String GETMYORDERS="getmyorders";
    public static final String GETORDERSFORADMIN="getordersforadmin";
    public static final String CANCELORDER="cancelorder";
    public static final String DELETEORDER="deleteorder";


    public static final  String TRADESTATUS="tradestatus";//支付状态


    public static final int SHOPID=-1;
    public static final int TOPCATEGORY=0;//以及父类

    public interface Role{
        int CUSTOMER = 0; // 前台用户
        int ADMIN =1 ; //后台管理员
        int SHOPKEEPER=2;//店家
    }
    public interface ProductListOrderBy{
        Set<String> PRICE_ASC_DESC= Sets.newHashSet("price_desc","price_asc");
    }
    public interface  PayType{
        int ONLINE=1;//线上支付
    }
    public interface  PayPlatform{
        int ALIPAY=1;//支付宝
        int WEIXINPAY=2;//微信支付
        int BALANCEPAY=3;//余额支付
    }
    public interface  Balance{
        String id="12345";
        String name="余额充值";

    }
    public interface  payDetail{
        String goodPay="商品支付";
        String balancePay="余额充值";
    }


    public enum ProductStatus{
        ON_SALE(1,"在售"),
        OFF_SALE(2,"下架或未上架"),
        ;
        private int code;
        private String description;
        ProductStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }

    public enum CategoryStatus{
        USE(1,"使用"),
        UNUSE(2,"废弃"),
        ;
        private int code;
        private String description;
        CategoryStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }

    public enum CartItemCheckedStatus{
        SELECTED(1,"选中"),
        UNSELECTED(2,"未选中"),
        ;
        private int code;
        private String description;
        CartItemCheckedStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }

    public enum OrderStatus{
        CANCEL(0,"已取消"),
        UNPAY(10,"待付款"),
        PAYED(20,"待发货"),
        WAITGOODS(30,"待收货"),
        FINISHED(40,"已完成")

        ;
        private int code;
        private String description;
        OrderStatus(int code, String description){
            this.code = code;
            this.description = description;
        }

        public int getCode() {
            return code;
        }

        public String getDescription() {
            return description;
        }
    }

}
